package la.iok.hzsvn.lewin.movie.cloud.entity;

import java.util.Date;
import java.util.Objects;

/**
 * 用户角色
 */
public class UserRole {
    /**
     * 自增id
     */
    private Long id;
    /**
     * 用户id
     */
    private Long userId;
    /**
     * 角色id
     */
    private Long roleId;
    /**
     * 组织id
     */
    private Long orgUnitId;
    /**
     * 获取权限的时间
     */
    private Date addTime;

    private Long score;


    public UserRole() {
    }

    public UserRole(Long userId, Long roleId, Long orgUnitId) {
        this.userId = userId;
        this.roleId = roleId;
        this.orgUnitId = orgUnitId;;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public Long getOrgUnitId() {
        return orgUnitId;
    }

    public void setOrgUnitId(Long orgUnitId) {
        this.orgUnitId = orgUnitId;
    }

    public Date getAddTime() {
        return addTime;
    }

    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        UserRole userRole = (UserRole) o;
        return Objects.equals(id, userRole.id) && Objects.equals(userId, userRole.userId) && Objects.equals(roleId, userRole.roleId) && Objects.equals(orgUnitId, userRole.orgUnitId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, userId, roleId, orgUnitId,score);
    }


    public Long getScore() {
        return score;
    }

    public void setScore(Long score) {
        this.score = score;
    }
}